package com.wangshouyu.mp.pay.v3.common.request;

import java.io.Serializable;
import java.security.PrivateKey;
import java.util.Objects;

/**
 * @author 王守钰
 * @description V3版本支付请求基础类
 * @date 2020/8/14 16:48
 */
public abstract class BaseV3PayRequest implements Serializable {

    /**
     * 证书信息
     */
    private PrivateKey privateKey;

    /**
     * 商户id
     */
    private String mchId;

    /**
     * 商户证书序列号
     */
    private String mchSerialNo;

    public PrivateKey getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(PrivateKey privateKey) {
        this.privateKey = privateKey;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getMchSerialNo() {
        return mchSerialNo;
    }

    public void setMchSerialNo(String mchSerialNo) {
        this.mchSerialNo = mchSerialNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BaseV3PayRequest that = (BaseV3PayRequest) o;
        return Objects.equals(privateKey, that.privateKey) &&
                Objects.equals(mchId, that.mchId) &&
                Objects.equals(mchSerialNo, that.mchSerialNo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(privateKey, mchId, mchSerialNo);
    }

    @Override
    public String toString() {
        return "BaseV3PayRequest{" +
                "privateKey=" + privateKey +
                ", mchId='" + mchId + '\'' +
                ", mchSerialNo='" + mchSerialNo + '\'' +
                '}';
    }
}
